<template>
	<div class="mian">
		<pidDetail ref="pid-detail" @backList="backList" v-if="detail"></pidDetail>
		<employeeContent v-show="!detail" @showdetail="showDetail"></employeeContent>
	</div>
</template>

<script>
import employeeContent from './content.vue';
import pidDetail from './detail.vue';
export default {
	data() {
		return {
			detail: false
		};
	},
	components: {
		employeeContent,
		pidDetail
	},
	created() {
		if (this.$route.query.staffId) {
			this.showDetail(this.$route.query);
		}
	},
	methods: {
		showDetail(params) {
			console.log('永远都会有时间', params);
			this.detail = true;
			this.$nextTick(() => {
				this.$refs['pid-detail'].detailRefresh(params);
			});
		},
		backList() {
			this.detail = false;
		}
	}
};
</script>

<style lang="stylus" scoped>
.mian {
	height calc(100vh - 60px )
}
</style>
